package com.oracle.jimu.service;

import java.util.List;

import com.oracle.jimu.bean.Order;
import com.oracle.jimu.dao.OrderDao;

public class OrderServiceImpl implements OrderService{
	private OrderDao orderDao;
	

	/**
	 * @return the orderDao
	 */
	public OrderDao getOrderDao() {
		return orderDao;
	}

	/**
	 * @param orderDao the orderDao to set
	 */
	public void setOrderDao(OrderDao orderDao) {
		this.orderDao = orderDao;
	}

	
	@Override
	public void deleteOrder(Integer id) {
		// TODO Auto-generated method stub
		orderDao.deleteOrder(id);
	}

	@Override
	public List<Order> selectUserOrder(String username) {
		// TODO Auto-generated method stub
		List l = orderDao.selectUserOrder(username);
		return l;
	}
	@Override
	public Order orderDetail(Integer id) {
		// TODO Auto-generated method stub
		Order o = orderDao.orderDetail(id);
		return o;
	}

	@Override
	public List<Order> getOrders(Integer flag) {
		// TODO Auto-generated method stub
		return orderDao.getOrders(flag);
	}

	@Override
	public void addOrder(Integer id) {
		// TODO Auto-generated method stub
		orderDao.addOrder(id);
	}

	@Override
	public void updateOrder(Order order) {
		// TODO Auto-generated method stub
		orderDao.updateOrder(order);
	}

	@Override
	public Order getOrderByUserId(Integer id){
		// TODO Auto-generated method stub
		return orderDao.getOrderByUserId(id);
	}

	@Override
	public List<Order> getOrdersByName(String username,Integer id) {
		// TODO Auto-generated method stub
		return orderDao.getOrdersByName(username,id);
	}

	@Override
	public void updateTotalPrice(Integer id, double totalprice) {
		// TODO Auto-generated method stub
		orderDao.updateTotalPrice(id, totalprice);
	}

	@Override
	public Integer getCartNum(String name, Integer flag) {
		// TODO Auto-generated method stub
		return orderDao.getCartNum(name, flag);
	}
}
